

********************************************************************************
* Figure 7: Daily Decomposition of the 3-day FOMC window
********************************************************************************

*********************************
* (A) Daily data
*********************************

use "../data/final_data_fed_secular_decline", clear

keep if date >= mdy(6,1,1989)
drop if date >= mdy(7,1,2021)

local x "usgg10_chg"

sort date
generate FOMC_change  = `x'  			if !missing(fomc_meet[_n+1]) | !missing(fomc_meet) | !missing(fomc_meet[_n-1])
generate preday_FOMC_change  = `x'  	if !missing(fomc_meet[_n+1])
generate sameday_FOMC_change  = `x'  	if !missing(fomc_meet)
generate postday_FOMC_change  = `x'  	if !missing(fomc_meet[_n-1])	

gen cum_`x'					= sum(`x')
gen cum_FOMC_change 		= sum(FOMC_change)
gen cum_preday_FOMC_change 	= sum(preday_FOMC_change)
gen cum_sameday_FOMC_change = sum(sameday_FOMC_change)
gen cum_postday_FOMC_change = sum(postday_FOMC_change)

line cum_preday_FOMC_change cum_sameday_FOMC_change cum_postday_FOMC_change date, ///
	scheme(s1mono) lcolor(gs9 red gs3) ///
	xlabel(, format(%tdCCYY)) ///
	ylabel(, angle(horizontal)) ///
	ytitle("Cumulative yield change (%)") ///
	xtitle("") ///
	legend(cols(1) pos(7) ring(0) symxsize(*0.5) ///
	label(1 "Day -1") label(2 "Day 0 (= FOMC meeting)") label(3 "Day +1"))	
	graph export "../figures/figure7a.png", replace	